package com.example.demo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.annotation.CheckNull;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

/**
 * @author leiliang
 * @version 1.0
 * @Description
 * @date 2021/6/8 18:52
 */
@Data
public class Apple {


    private Integer id;

    @CheckNull
    private String name;
    private BigDecimal money;
    private Integer num;

    public Apple() {
    }

    public Apple(Integer id, String name, BigDecimal money, Integer num) {
        this.id = id;
        this.name = name;
        this.money = money;
        this.num = num;
    }


    public static void main(String[] args) {

        Apple apple = new Apple();
        String name = "";
        apple.setName(name);
        String name2 = "222";
        apple.setName(name2);



       /* Apple apple = new Apple();
        String name = "111";
        apple.setName(name);
        System.out.println(name);
        String name2 = "222";
        apple.setName(name2);
        if (!name.equals(name2)){

        }
        System.out.println(JSONObject.toJSONString(apple));*/
   /*
        Set<String> filter  = new HashSet<>();
        filter.add("1");
        filter.add("2");
        filter.add("3");
        filter.add("4");
        if (filter.size() > 3){
            System.out.println("长度大于3");
        }else {
            System.out.println("长度小于3");

        }*/
    }
}
